from django.contrib import admin
from django.urls import path
from myapp.views import depart,user,prety,admin,account,task,order,data,upload
from django.urls import path, re_path
from django.views.static import serve
from django.conf import settings


urlpatterns = [
    # 访问media开头的路径就去根目录下找media下的资源，且会将静态文件存在指定目录下（meida下）
    re_path(r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT}, name='media'),
    # path('admin/', admin.site.urls),
    # 部门管理
    path('depart/list/', depart.depart_list),
    path('depart/add/', depart.depart_add),
    path('depart/excel/', depart.depart_excel),
    path('depart/del/', depart.depart_del),
    path('depart/<int:nid>/update/', depart.depart_update),
    # 用户管理
    path('user/list/', user.user_list),
    path('user/add/', user.user_add),
    path('user/add/', user.user_add),
    path('user/model/form/add/', user.user_model_form_add),
    path('user/<int:nid>/update/', user.user_update),
    path('user/<int:nid>/delete/', user.user_delete),
    # 靓号管理
    path('prety/list/', prety.prety_list),
    path('prety/add/', prety.prety_add),
    path('prety/<int:nid>/update/', prety.prety_update),
    path('prety/<int:nid>/delete/', prety.prety_delete),
    # 管理员
     path('admin/list/', admin.admin_list),
     path('admin/add/', admin.admin_add),
     path('admin/<int:nid>/update/', admin.admin_update),
     path('admin/<int:nid>/delete/', admin.admin_delete),
     path('admin/<int:nid>/reset/', admin.admin_reset),
    #登录
    path('login/', account.login),
    path('img/code/', account.img_code),
    path('loginout/', account.loginout),
    #任务管理
    path('task/list/', task.task_list),
    path('task/ajax/', task.task_ajax),
    path('task/add/', task.task_add),
    # 订单管理
    path('order/list/', order.order_list),
    path('order/add/', order.order_add),
    path('order/delete/', order.order_delete),
    path('order/data/', order.order_data),
    path('order/update/<int:uid>/', order.order_update),
    # 数据统计
    path('data/list/', data.data_list),
    path('data/char/', data.data_char),
    # 上传文件
    path('upload/form/', upload.upload_form),
    path('upload/model_form/', upload.upload_modelform),
    path('city/list/', upload.city_list),

]
